#ifndef _CHART_PARSER_H_
#define _CHART_PARSER_H_

#include "pch.h"

class Note;

class ChartParser
{
public:
	ChartParser();

	typedef QMap<long, double> BpmMap;
	typedef QMapIterator<long, double> BpmMapIterator;

	typedef QMap<long, int> MeasuresMap;
	typedef QMapIterator<long, int> MeasuresMapIterator;

	typedef QMap<long, QString> EventMap;

	typedef QMap<long, double> TimeUnitMap;
	typedef QMapIterator<long, double> TimeUnitMapIterator;

	typedef std::multimap<double, Note*> InstrumentTrack;


	InstrumentTrack parse(QString chartFile, QString &songFileName);
	void parseSongSection(QTextStream &stream);
	void parseSyncTrackSection(QTextStream &stream);
	void parseEventsSection(QTextStream &stream);
	void parseInstrumentSection(InstrumentTrack &track, QTextStream &stream);
protected:

private:



	QString _songName;
	QString _artistName;
	QString _charterName;
	float _offset;
	int _resolution;
	QString _player2Instrument;
	int _difficulty;
	float _previewStart;
	float _previewEnd;
	QString _genre;
	QString _mediaType;
	QString _musicStream;

	BpmMap _bpms;
	MeasuresMap _measures;
	EventMap _events;
	TimeUnitMap _timeUnits;

	InstrumentTrack _expertTrack;
};

#endif